<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    fetch('https://restapi.amap.com/v3/weather/weatherInfo?city=110101&key=05c7345a1781fe91229d0daba72e5d2b')
  .then(response => response.json())      // 解析返回的JSON数据
  .then(data => {
    console.log('获取到的数据：', data);
    document.getElementById('result').innerText = JSON.stringify(data, null, 2);
  })
  .catch(error => {
    console.log('请求失败：', error);
  });
</script>
</html>